<template>
  <div>
    <!-- 表单 -->
    <el-form ref="form" :model="link" label-width="80px">
      <el-form-item label="名称">
        <el-input v-model="link.linkName" />
      </el-form-item>
      <el-form-item label="链接">
        <el-input v-model="link.linkUrl" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">立即添加</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
// 引入接口API
import linkApi from '@/api/link'
export default {
  data() {
    return {
      link: {}
    }
  },
  methods: {
    onSubmit() {
      linkApi.save(this.link).then(Response => {
        this.$message.success(Response.msg)
        this.$emit('closeAddDialog')
        this.$emit('getlinkList')
      })
    }
  }
}
</script>

